﻿using DtoFw;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace SceneEvidenceAPI.Controllers
{
    /// <summary>
    /// 任务接口
    /// </summary>
    [Route("api/task")]
    public class TaskController : BaseController
    {
        private readonly TaskService _taskService;
        public TaskController(TaskService taskService)
        {
            this._taskService = taskService;
        }
        /// <summary>
        /// 开启Hanfire服务
        /// </summary>
        /// <param name="relevanceId"></param>
        /// <returns></returns>
        [HttpGet("hangfire/start")]
        [AllowAnonymous]
        public BaseResult HangfireStart()
        {
            this._taskService.PulseOnHangfireServer();
            return BaseResult.Succeed();
        }
    }
}
